package com.zhoujian.Bridge;

import com.zhoujian.Bridge.Implementor.MysqlDriver;
import com.zhoujian.Bridge.abstractor.Connection;
import com.zhoujian.Bridge.abstractor.Driver;
import com.zhoujian.Bridge.abstractor.DriverManager;
import com.zhoujian.Bridge.abstractor.DriverManagerOne;

public class Main {
    public static void main(String[] args) {
        //先创建一个驱动实例,我们可以通过反射来构建
        Driver driver = new MysqlDriver();

        //注册给DriverManager
        DriverManager driverManager = new DriverManagerOne();
        driverManager.register(driver);

        Connection connection = driverManager.getConnection();
        System.out.println(connection);
    }
}
